<template>
    <div class="personal-right">
					<div class="detail-top">
						<div class="head-portrait">
							<img src="../../assets/img/photo.jpg" alt="#"  class="avatar"/>
							<div class="avatar-detail">
								<div>
									<!-- <p><h2>151*5590</h2></p> -->
									<p>{{time}}好~</p>
									<p><a href="#">修改个人信息 ></a></p>
								</div>
							</div>
						</div>
						<div class="binding">
							<div class="binding-detail">
								<p>账户安全：{{safety}}</p>
								<p>绑定手机：{{phone}}</p>
								<p> 
									<span>绑定邮箱：</span>
									<a href="#"><button>绑定</button></a>
								</p>
							</div>
						</div>
					</div>
					<div class="line"></div>
					<div class="detail-buttom">
						<div class="detail-buttom-top">
							<div>
								<img src="../../assets/img/portal-icon-1.png" alt="#" />
								<div class="position-top">
									<p>待支付的订单：<span class="count">{{noPayCount}}</span></p>
									<a href="#">查看待支付订单 > </a></div>
								</div>
							<div>
								<img src="../../assets/img/portal-icon-2.png" alt="#" />
								<div class="position-buttom">
									<p>待收货的订单：<span class="count">{{noReceiveCount}}</span></p>
									<p><a href="#">查看待收货订单 > </a></p>
								</div>
							</div>
						</div>
						<div class="detail-buttom-buttom">
							<div>
								<img src="../../assets/img/portal-icon-3.png" alt="#" />
								<div class="position-top">
									<p>待评价商品数：<span class="count">{{noEvaluateCount}}</span></p>
									<p><a href="#">查看待评价订单 ></a></p>
								</div>
							</div>
							<div>
								<img src="../../assets/img/portal-icon-4.png" alt="#" />
								<div class="position-buttom">
									<p>喜欢的商品：<span class="count">{{favCount}}</span></p>
									<p><a href="#">查看喜欢的商品 > </a></p>
								</div>
							</div>
						</div>
					</div>
				</div>
</template>

<script>
const Mock = require('mockjs')
Mock.mock('user',()=>{
    return{phone:5463561111,safety:'安全'}
}) 
export default {
	data(){
		return{
			time:'',phone:'',safety:'',noPayCount:'',noReceiveCount:'',
			noEvaluateCount:'',favCount:''
		}
	},
	methods:{
		getMsg(){
			var timer = new Date();
			timer = timer.getHours();
			if(timer>=12){
				this.time = '下午';
			}else{
				this.time = '上午';
			};
			this.axios.get('user').then((res)=>{
				this.phone = res.data.phone;
				this.safety = res.data.safety;
			}).catch((err)=>{
				throw err;
			})
		},
		getOrder(){
			this.axios.get('order').then((res)=>{
				this.noPayCount = res.data.noPayCount;
				this.noReceiveCount = res.data.noReceiveCount;
				this.noEvaluateCount = res.data.noEvaluateCount;
				this.favCount = res.data.favCount;
				this.$(".count").css('color','orange');
			}).catch((err)=>{
				throw err;
			})
		}
	},
	mounted(){
		this.getMsg();
		this.getOrder();
	}
};
</script>

<style>
</style>
